home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / os2 / pmp42b.zip / PMPAPI.H < prev    next >
C/C++ Source or Header  |  1996-05-26  |  17KB  |  290 lines

  1. /***************************************************************************
  2. PM Patrol API C/C++ header
  3.  
  4. API: DCFGetStats (Data Collection Facility - retrieve stats)
  5. -----------------------------------------------------------------------------
  6.      Prototype:  APIRC APIENTRY DCFGetStats (PDCFSTATS pDCFStats)
  7.      Parms:      PPDCFSTATS         ... Address to DCFSTATS structure
  8.      Returns:    DCF_NO_ERROR       ... Succesfull with no errors
  9.                  DCF_PARM_ERROR     ... Invalid parm specified
  10.                  DCF_INACTIVE_ERROR ... DCF not active
  11.  
  12.      Notes:      Statistics are updated at frequencies defined in the PM Patrol
  13.                  "Refresh Settings" dialog under "Settings" options.
  14.                  Refer to PM Patrol on-line help for details and examples.
  15.  
  16. API: DCFVerify   (Data Collection Facility - verify DCF active state)
  17. -----------------------------------------------------------------------------
  18.      Prototype:  BOOL APIENTRY DCFVerify (void)
  19.      Parms:      None
  20.      Returns:    TRUE               ... DCF active
  21.                  FALSE              ... DCF not active
  22.  
  23. API: DCFUserDefined (Data Collection Facility - User defined monitor)
  24. -----------------------------------------------------------------------------
  25.      Prototype:  APIRC APIENTRY DCFUserDefined (PCHAR buffer)
  26.      Parms:      None
  27.      Returns:    DCF_NO_ERROR       ... Succesfull with no errors
  28.                  DCF_PARM_ERROR     ... Invalid parm specified
  29.                  DCF_INACTIVE_ERROR ... DCF not active
  30.  
  31. API: PMPShutDown (Shutdown PM Patrol and DCF)
  32. -----------------------------------------------------------------------------
  33.      Prototype:  BOOL APIENTRY PMPShutDown (void)
  34.      Parms:      None
  35.      Returns:    TRUE               ... Succesfull with no errors
  36.                  FALSE              ... PM Patrol not active
  37. ****************************************************************************/
  38.  
  39. /* double inclusion */
  40. #ifndef INCL_PMPAPI
  41. #define INCL_PMPAPI
  42.  
  43. /* define additional types */
  44. #if !defined(OS2_INCLUDED) && !defined(INCL_NEWTYPES1)
  45. #define INCL_NEWTYPES1
  46. typedef short            SHORT;
  47. typedef SHORT *          PSHORT;
  48. typedef unsigned short   USHORT;
  49. typedef USHORT *         PUSHORT;
  50. typedef long             LONG;
  51. typedef LONG *           PLONG;
  52. typedef unsigned long    ULONG;
  53. typedef ULONG *          PULONG;
  54. typedef char             CHAR;
  55. typedef CHAR *           PCHAR;
  56. typedef unsigned char    UCHAR;
  57. typedef UCHAR *          PUCHAR;
  58. typedef UCHAR            BYTE;
  59. typedef BYTE *           PBYTE;
  60. typedef int              INT;
  61. typedef INT *            PINT;
  62. typedef void             VOID;
  63. typedef VOID *           PVOID;
  64. typedef ULONG            BOOL;
  65. typedef BOOL *           PBOOL;
  66. #endif
  67.  
  68. #ifndef INCL_NEWTYPES2
  69. #define INCL_NEWTYPES2
  70. typedef double           DOUBLE;
  71. typedef DOUBLE *         PDOUBLE;
  72. typedef INT              FD;
  73.  
  74. #ifdef UNIX
  75. typedef INT              APIRC;
  76. typedef APIRC *          PAPIRC;
  77. typedef pid_t            PID;
  78. typedef unsigned int     TID;
  79. #ifndef APIENTRY
  80. #define APIENTRY
  81. #endif
  82. #else
  83. typedef ULONG            APIRC;
  84. typedef APIRC *          PAPIRC;
  85. typedef USHORT           APIRC16;
  86. typedef APIRC16 *        PAPIRC16;
  87. typedef USHORT           HFILE16;
  88. typedef HFILE16 *        PHFILE16;
  89. #ifndef APIENTRY
  90. #define APIENTRY         _System
  91. #endif
  92. #endif
  93. #endif
  94.  
  95. /* define DCF specifics */
  96. #define DCF_NETWID_SIZE                     15
  97. #define DCF_NETUID_SIZE                     15
  98. #define DCF_NETDID_SIZE                     15
  99. #define DCF_NETSID_SIZE                     15
  100. #define DCF_DRVONL_SIZE                     26
  101. #define DCF_GRAPH_SIZE                      11
  102. #define DCF_EXENAME_SIZE                    8
  103. #define DCF_PSTATS_SIZE                     64
  104. #define DCF_USER_SIZE                       20
  105. #define DCF_VERSION_SIZE                    12
  106.  
  107. #define DCF_NO_ERROR                        0
  108. #define DCF_PARM_ERROR                      1
  109. #define DCF_INACTIVE_ERROR                  2
  110.  
  111. /* structure definitions */
  112. #pragma pack(1)
  113. typedef struct dcfpstats
  114. {
  115.   ULONG         pid;                             /* process id               */
  116.   ULONG         ppid;                            /* parent process id        */
  117.   ULONG         sid;                             /* session id               */
  118.   ULONG         type;                            /* process type PROG_*      */
  119.   BOOL          mmt32Bit;                        /* 16 or 32-bit indicator   */
  120.   USHORT        modHandle;                       /* module handle            */
  121.   USHORT        tidCount;                        /* thread count             */
  122.   USHORT        semCount;                        /* sem count                */
  123.   USHORT        modCount;                        /* mod count                */
  124.   USHORT        shrCount;                        /* sharemem count           */
  125.   USHORT        maxClass;                        /* max thread pri class     */
  126.   LONG          startTime;                       /* start time (time_t)      */
  127.   USHORT        cpuPct;                          /* cpu percent              */
  128.   USHORT        runCnt;                          /* internal to PMP          */
  129.   CHAR          exeName[DCF_EXENAME_SIZE+1];     /* executable name (8.3)    */
  130. } DCFPSTATS, *PDCFPSTATS;
  131.  
  132. typedef struct dcfstats
  133. {
  134.   CHAR          pmpVersion[DCF_VERSION_SIZE+1];  /* PMP version              */
  135.   LONG          pmpStartTime;                    /* PMP start time (time_t)  */
  136.   BOOL          hpfs32ActInd;                    /* hpfs 386 active indicator*/
  137.   BOOL          mmActInd;                        /* mmos2 active indicator   */
  138.   BOOL          netActInd;                       /* net active indicator     */
  139.   BOOL          netLogonInd;                     /* net logged-on indicator  */
  140.   BOOL          lpt1ActInd;                      /* LPT1 monitor indicator   */
  141.   BOOL          lpt2ActInd;                      /* LPT2 monitor indicator   */
  142.   BOOL          lpt3ActInd;                      /* LPT3 monitor indicator   */
  143.   BOOL          spoolActInd;                     /* Spooler active indicator */
  144.   LONG          upDateTime;                      /* DCF up-date time (time_t)*/
  145.  
  146.   ULONG         upTimeSecs;                      /* system up-time seconds   */
  147.   ULONG         iconTimeSecs;                    /* internet connect seconds */
  148.   CHAR          netWSId    [DCF_NETWID_SIZE+1];  /* net workstation id       */
  149.   CHAR          netUserId  [DCF_NETUID_SIZE+1];  /* net logon id             */
  150.   CHAR          netDomainId[DCF_NETDID_SIZE+1];  /* net logon domain         */
  151.   CHAR          netServerId[DCF_NETSID_SIZE+1];  /* net logon server         */
  152.   DOUBLE        netIn;                           /* net req in bytes         */
  153.   DOUBLE        netOut;                          /* net req out bytes        */
  154.   DOUBLE        lpt1TotIO;                       /* lpt1 I/O total bytes     */
  155.   DOUBLE        lpt1TotTime;                     /* lpt1 total ms            */
  156.   ULONG         lpt1TotJobs;                     /* lpt1 total jobs          */
  157.   DOUBLE        lpt2TotIO;                       /* lpt2 I/O total bytes     */
  158.   DOUBLE        lpt2TotTime;                     /* lpt2 total ms            */
  159.   ULONG         lpt2TotJobs;                     /* lpt2 total jobs          */
  160.   DOUBLE        lpt3TotIO;                       /* lpt3 I/O total bytes     */
  161.   DOUBLE        lpt3TotTime;                     /* lpt3 total ms            */
  162.   ULONG         lpt3TotJobs;                     /* lpt3 total jobs          */
  163.   CHAR          drivesOnLine[DCF_DRVONL_SIZE+1]; /* drive map array          */
  164.   CHAR          drive1;                          /* drive letter             */
  165.   BOOL          drive1OffLine;                   /* drive off line indicator */
  166.   DOUBLE        drive1Size;                      /* drive size bytes         */
  167.   DOUBLE        drive1Free;                      /* drive free bytes         */
  168.   CHAR          drive2;                          /* drive letter